// import { onUnmounted } from "vue"

// export const useWindowEvent = (eventType, callback) => {
// 	window.addEventListener(eventType, callback)

// 	const removeEventHandler = () =>
// 		window.removeEventListener(eventType, callback)
// 	onUnmounted(removeEventHandler)
// }
// 窗口事件处理函数
import { onUnmounted } from 'vue';
export const useWindowEvent = (eventType, callback) => {
    // 新增监听事件
    window.addEventListener(eventType, callback)
    // 移除监听事件
    const removeEventHandler = () => window.removeEventListener(eventType, callback)
    onUnmounted(removeEventHandler)
}